﻿@model ENail.Portal.Web.Models.NailServiceViewModel

@{
    ViewBag.Title = Model.Id == 0 ? "Add new nail service" : "Update nail service";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


    @using (Html.BeginForm())
    {
    <table>
        <tr>
            <td><input type="button" value="Save" onclick="document.forms(0).submit()" /></td>
            <td><input type="button" value="Discard" onclick="document.location='@Url.Action("List", "NailService")'" /></td>
            <td><input type="button" value="Delete" onclick="document.forms(1).submit()" style="visibility:@(Model.Id == 0 ? "hidden" : "visible")" /></td>
        </tr>
    </table>

    <table>
        <tr>
            <td>@Html.ValidationSummary()</td>
            <td></td>
        </tr>
        <tr>
            <td>Service Id:</td>
            <td>@(Model.Id == 0 ? "-New-" : Model.Id.ToString())</td>
        </tr>
        <tr>
            <td>Service Name(*):</td>
            <td>@Html.TextBoxFor(x => x.ServiceName)</td>
        </tr>
        <tr>
            <td>Parent Service:</td>
            <td>@Html.DropDownListFor(x => x.ParentServiceId,
                                    new SelectList(Model.ServiceList, 
                                                    "Id", 
                                                    "ServiceName"),
                                    "-Select Parent-")
            </td>
        </tr>
        <tr>
            <td>Category:</td>
            <td>@Html.DropDownListFor(x => x.CategoryId,
                                    new SelectList(Model.CategoryList, 
                                                    "Id", 
                                                    "CategoryName"),
                                    "-Select Category-")
            </td>
        </tr>
        <tr>
            <td>Price(*):</td>
            <td>@Html.TextBoxFor(x => x.Price)</td>
        </tr>
        <tr>
            <td>Description:</td>
            <td>@Html.TextBoxFor(x => x.Description)</td>
        </tr>
    </table>
    }

    @using (Html.BeginForm("Delete", "NailService", new { id = Model.Id }))
    {
    }

